//
//  HomeQuestionAlertVC.m
//  ImGuider
//
//  Created by llt on 2017/9/8.
//  Copyright © 2017年 AudioCtrip. All rights reserved.
//

#import "HomeQuestionAlertVC.h"

@interface HomeQuestionAlertVC ()
@property (weak, nonatomic) IBOutlet UIImageView *bgImageView;
@property (weak, nonatomic) IBOutlet UIButton *startBtn;

@property (nonatomic, copy) void (^ block) ();

@end

@implementation HomeQuestionAlertVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.6];
    self.bgImageView.image = [UIImage imageNamed:MYLocalizedString(@"HOME_QUESTION_BG", nil)];
    
    [self.startBtn setImage:[UIImage imageNamed:MYLocalizedString(@"HOME_QUESTION_START_BTN", nil)] forState:UIControlStateNormal];
}

- (void)showWithVC:(UIViewController *)vc Block:(void(^)())block {
    
    self.block = block;
    
    self.modalPresentationStyle = UIModalPresentationOverCurrentContext|UIModalPresentationFullScreen;
    [vc presentViewController:self animated:YES completion:nil];
}

- (IBAction)openQuestion:(UIButton *)sender {
    
    [self dissmissVC:sender];
    
    if (self.block) {
        self.block();
    }
}

- (IBAction)dissmissVC:(UIButton *)sender {
    
    [self dismissViewControllerAnimated:YES completion:nil];
}


@end
